home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19960425-19960715 / 000253_news@columbia.edu _Mon Jun 17 16:53:26 1996.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: news@columbia.edu
  2. Received: from apakabar.cc.columbia.edu (apakabar.cc.columbia.edu [128.59.35.159]) by watsun.cc.columbia.edu (8.7.5/8.7.3) with ESMTP id QAA18307 for <kermit.misc@watsun>; Mon, 17 Jun 1996 16:53:25 -0400 (EDT)
  3. Received: (from news@localhost) by apakabar.cc.columbia.edu (8.7.5/8.7.3) id QAA20230 for kermit.misc@watsun; Mon, 17 Jun 1996 16:53:20 -0400 (EDT)
  4. Path: news.columbia.edu!sol.ctr.columbia.edu!news.uoregon.edu!vixen.cso.uiuc.edu!uwm.edu!news-res.gsl.net!news.gsl.net!nntp.coast.net!oleane!tank.news.pipex.net!pipex!news.mathworks.com!uunet!in1.uu.net!news2.digex.net!digex.net!not-for-mail
  5. From: hashmi@cnj.digex.net (Atiqullah Hashmi)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: problem with writing "<ESC>P" into the port
  8. Date: 17 Jun 1996 15:10:46 -0400
  9. Organization: Express Access Online Communications, New Jersey, USA
  10. Lines: 46
  11. Distribution: na
  12. Message-ID: <4q4ajm$nev@cnj.digex.net>
  13. NNTP-Posting-Host: cnj.digex.net
  14.  
  15.  
  16. Hi,
  17.  
  18. This is not a Kermit protocol question, but I considered this to
  19. be the best place to expect any answer to my question.
  20.  
  21. I am implementing a simple protocol(called TAP) for paging. I dial-in to
  22. a paging service via modem and send/receive some char. streams.
  23. At one point, I have to send this:
  24.  
  25. <ESC>PG1000000<CR>
  26. and in response receive 
  27. <ACK><CR>
  28.  
  29. where  I have #define'd ESC as 0x1B , ACK as 0x06 etc.
  30.  
  31. Here is how I am doing it:
  32.  
  33.         int len=0;
  34.     char sbuf[500], ebuf[500];
  35.  
  36.         sbuf[len++] = ESC;
  37.         strncpy(sbuf+len, "PG1000000", strlen("PG1000000"));
  38.         len += strlen("PG1000000");
  39.         sbuf[len++] = CR;
  40.         sbuf[len] = '\0';
  41.  
  42.         ebuf[0] = ACK;
  43.         ebuf[1] = '\0';
  44.  
  45.         cout << "sbuf=" << sbuf << "; ebuf=" << ebuf << endl;    ---(1)
  46.         sendAndExpect(sbuf, ebuf);    //writes to modem and receives chars
  47.  
  48. The program hangs at line(1) i.e.
  49. sbuf=
  50.  
  51. such that even ^C and ^Z don't work and I have to close that window.
  52. Even if I comment out line(1), it hangs when writes to the port.
  53.  
  54. It seems that <ESC>P   (in <ESC>PG1000000<CR>) is a bad combination
  55. since replacing P with p, at least it didn't hang. Is that right ?
  56.  
  57. What is wrong here ? (Note that protocol spec. doesn't say I have
  58. to convert control chars. to printable ASCII chars.)
  59.  
  60. AH